package org.jeecg.modules.friends.enums;

/**
 * @author cold
 * @version 1.0
 * @data 2024/5/27 11:27
 */
public enum AuthStatusEnum {
    UNKNOWN(0, "未知"),

    INITIALIZE(10, "初始化"),
    SUBMITTED(20, "已提交，认证中"),

    SYSTEM_REJECTED(30, "系统拒绝待人工确认"),

    SYSTEM_PASSED(40, "系统通过待人工确认"),

    PASSED(50, "已通过"),
    UN_PASSED(60, "未通过"),
    ;
    private int code;
    private String desc;

    AuthStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AuthStatusEnum of(Integer code) {
        for (AuthStatusEnum value : AuthStatusEnum.values()) {
            if (code != null && value.getCode() == code) {
                return value;
            }
        }
        return UNKNOWN;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
